from typing import Optional

from beanie import Document


class Role(Document):
    name: Optional[str] = None
    identity: str

    class Config:
        schema_extra = {
            "example": {
                "name": "角色名称",
                "identity": "英文标识",
            }
        }


class RolePermission(Role):
    path: str
    method: str

    class Config:
        schema_extra = {
            "example": {
                "name": "角色名称",
                "identity": "角色标识",
                "path": "权限路径",
                "method": "权限操作"
            }
        }
